<div class="m-tab s-tab">
	<h2 class="u-tt">文章管理</h2>
	<ul class="u-tabs">
		<li><a href="{$url|'AdminContent/index'}">文章列表</a></li>
		<li><a href="#tab1" class="tab-on tab-a">{$actionName}文章</a></li>
		<li><a href="#tab2" class="tab-a">高级属性</a></li>
	</ul>
</div>
<div class="m-form">
	<form name="" action="<?php echo url('AdminContent/'.$action.'Data'); ?>" method="post" id="form">
		<fieldset>
			<div id="tab1">
				<div class="formitm">
					<label class="lab">分类：</label>
					<div class="ipt">
						<select class="u-slt" id="class_id" name="class_id">
							<option value="0">==选择分类==</option>
							<!--{loop="$categoryList $vo"}-->
							<option {if="$info['class_id']==$vo['class_id']"} selected="selected"{/if} {if="$vo['type']==0"} value="0" style="background-color:#ccc"  disabled="disabled" {else} value="{$vo.class_id}" {/if} >{$vo.cname}</option>
							<!--{/loop}-->
						</select>
					</div>
				</div>
				<div class="formitm">
					<label class="lab">标题：</label>
					<div class="ipt">
						<input name="title" type="text" class="u-ipt u-ipt-6" id="title" value="{$info.title}" maxlength="250" datatype="*" errormsg="内容标题未填写" />
						<span class="suffix">
						<label class="u-opt">
							<input name="font_bold" type="checkbox" value="1" {if="$info['font_bold']"} checked="checked" {/if} />
							加粗</label>
						<input type="text" name="font_bold"  class="u-ipt u-ipt-1 u-color"  id="font_bold" value="{$info.font_color}" />
						颜色</span>
						<p></p>
					</div>
				</div>
				
				<div class="formitm">
					<label class="lab">封面图：</label>
					<div class="ipt">
						<input type="text" name="image"  class="u-ipt u-ipt-4" id="image" value="{$info.image}"  />
						<span class="suffix">
						<button class="u-btn u-img-upload" type="button" data="image" preview="image_preview" id="image_button">上传</button>
						<button class="u-btn" type="button" id="image_preview">预览</button>
						</span> </div>
				</div>
				<div class="formitm">
					<label class="lab">内容：</label>
					<div class="ipt">
						<textarea name="content" id="content" class="u-editor" style="width:100%;height:400px;visibility:hidden;">{$info.content}</textarea>
					</div>
				</div>
				<div class="formitm">
					<label class="lab" >访问量：</label>
					<div class="ipt"> {if="!isset($info['views'])"}{$info.views=0}{/if}
						<input name="views" type="text" class="u-ipt u-ipt-1" value="{$info.views}" />
						顺序：
						{if="!isset($info['sequence'])"}{$info.sequence=0}{/if}
						<input name="sequence" type="text" class="u-ipt u-ipt-1" value="{$info.sequence}" />
						内容来源：
						{if="!isset($info['copyfrom'])"}{$info.copyfrom='duxcms'}{/if}
						<input name="copyfrom" type="text" class="u-ipt u-ipt-2" id="copyfrom" value="{$info.copyfrom}" />
					</div>
				</div>
				<div id="expand"></div>
				<div class="formitm">
					<label class="lab" >关键词：</label>
					<div class="ipt">
						<input name="keywords" type="text" class="u-ipt u-ipt-6" id="keywords" value="{$info.keywords}" maxlength="250" />
						<label class="u-opt">
							<input name="taglink" type="checkbox" value="1" checked="checked" />
							内容自动链接 </label>
					</div>
				</div>
				<div class="formitm">
					<label class="lab" >描述：</label>
					<div class="ipt">
						<textarea name="description" id="description" class="u-tta u-tta-6" >{$info.description}</textarea>
					</div>
				</div>
				<div class="formitm">
					<label class="lab" >更新时间：</label>
					<div class="ipt">
						<input name="time" type="text" class="u-ipt u-ipt-6 u-time" id="time" value="<?php if(empty($info['time'])){ echo date('Y-m-d H:i:s'); }else{ echo date('Y-m-d H:i:s',$info['time']); } ?>" maxlength="250" readonly="readonly" datatype="*" errormsg="更新时间不能为空！"   />
						<p>内容最后的更新时间</p>
					</div>
				</div>
				<div class="formitm">
					<label class="lab" >状态：</label>
					<div class="ipt">
						<?php if(!isset($info['status'])){ $info['status']=1; } ?>
						<label class="u-opt">
							<input name="status" type="radio" value="1" {if="$info['status']==1"} checked="checked" {/if} />
							显示</label>
						<label class="u-opt">
							<input name="status" type="radio" value="0" {if="$info['status']==0"} checked="checked" {/if} />
							隐藏</label>
					</div>
				</div>
			</div>
			<div id="tab2" class="m-tabpanel">
                <div class="formitm">
                  <label class="lab" >文章置顶：</label>
                  <div class="ipt">
                    <input name="type_top" type="text" class="u-ipt u-ipt-6 u-time" id="type_top" value="<?php if(!empty($info['type_top'])){ echo date('Y-m-d H:i:s',$info['type_top']); } ?>" maxlength="250" readonly="readonly" />
                    <p>请选择文章置顶截至时间，不置顶请留空</p>
                  </div>
                </div>
				<div class="formitm">
					<label class="lab" >跳转到：</label>
					<div class="ipt">
						<input name="url" type="text" class="u-ipt u-ipt-6" id="url" value="{$info.url}" maxlength="250"  />
						<p>跳转到其他地址</p>
					</div>
				</div>
				<div class="formitm">
					<label class="lab" >内容URL：</label>
					<div class="ipt">
						<input name="urltitle" type="text" class="u-ipt u-ipt-6" value="{$info.urltitle}" maxlength="250" />
						<p>不填写将自动生成，只能为英文数组下划线</p>
					</div>
				</div>
				<div class="formitm">
					<label class="lab" >独立模板：</label>
					<div class="ipt">
						<input name="tpl" type="text" class="u-ipt u-ipt-6" value="{$info.tpl}" maxlength="250" />
						<p>不填写继承栏目设置</p>
					</div>
				</div>
			</div>
			<div class="formitm formitm-1 formitm-2">
				<input name="content_id" id="content_id" type="hidden" value="{$info.content_id}" />
				<button class="u-btn" type="submit">保存</button>
				<button class="u-btn s-btn-c3" type="reset">重置</button>
				<span class="status" id="status"></span> </div>
		</fieldset>
	</form>
</div>
<script>
Do.ready('base','form','dialog','color','editor','sort','upload','calendar','tabs','region',function() {
	function loadForm(){
		//表单综合处理
		$('#form').duxFormPage({
			returnUrl:'{$url|"article/AdminContent/index"}',
			uploadUrl:'{$url|"article/ContentUpload/index"}',
			uploadParamsCallback:function(){
				return {
					class_id : $('#class_id').val()
				}
			}
		});
	}
	//AJAX获取扩展信息
	$('#class_id').change(function() {
		$.post('{$url|"duxcms/AdminFieldset/getField"}',{class_id:$(this).val(),content_id:$('#content_id').val()},
		function(html){
			$('#expand').html(html);
			loadForm();
		},'html');
	});
	loadForm();
	$('#class_id').change();
});
</script>